package com.itheima.thread.api.dem01;

public class ThreadDemo01 {

    public static void main(String[] args) {

//        Thread1 thread1 = new Thread1();
//        Thread1 thread2 = new Thread1();

        Thread1 thread1 = new Thread1("A");
        Thread1 thread2 = new Thread1("B");

        thread1.start();
        thread2.start();

        for (int i = 0; i < 5; i++) {
            System.out.println("main---" + i);
        }

        Thread currentThread = Thread.currentThread();
        String currentThreadName = currentThread.getName();
        System.out.println(currentThreadName);
    }
}
